<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorator="layouts/main" th:with="isLdap=${provider=='ldap'}">
<div class="island-landscape" layout:fragment="page-content">
    <div class="island-title">
        <h1><th:block th:unless="${isLdap}">Create</th:block><th:block th:if="${isLdap}">Link</th:block> your <th:block th:text="${!companyName.equals('Cloud Foundry') and isUaa ? (companyName + ' account') : 'account'}">account</th:block></h1>
    </div>
    <div class="island-content">
        <div th:text="|Email: ${email}|" th:unless="${error_message_code == 'code_expired'}" class="email-display">Email: user@example.com</div>
        <div th:if="${error_message_code}" class="alert alert-error">
            <p th:text="#{'account_activation.' + ${error_message_code}}">Error Message</p>
        </div>
        <div th:if="${error_message}" class="alert alert-error">
            <p th:text="#{'account_activation.' + ${error_message}}">Error Message</p>
        </div>
        <th:block th:unless="${error_message_code == 'code_expired'}" >
          <th:block th:if="${provider == 'uaa'}">
            <form th:action="@{/invitations/accept.do}" method="post" novalidate="novalidate">
                <input name="code" type="hidden" value="code" th:value="${code}"/>
                <input name="password" type="password" placeholder="Password" autocomplete="off" class="form-control"/>
                <input name="password_confirmation" type="password" placeholder="Confirm" autocomplete="off" class="form-control"/>

                <label th:if="${consent_text}" style="margin-bottom: 20px">
                    <input name="does_user_consent" type="checkbox" style="display: inline">
                    <span>I agree to </span>
                    <span th:if="!${consent_link}" th:text="${consent_text}"></span>
                    <a th:if="${consent_link}" th:text="${consent_text}" name="consent-link" th:href="@{${consent_link}}" target="_blank"></a>
                </label>

                <input type="submit" th:value="${!companyName.equals('Cloud Foundry') and isUaa ? 'Create ' + companyName + ' account' : 'Create account'}" class="island-button"/>
            </form>
          </th:block>
            <th:block th:if="${isLdap}">
                <p>Sign in with enterprise credentials: </p>
                <form th:action="@{/invitations/accept_enterprise.do}" method="post" novalidate="novalidate">
                    <input name="enterprise_email" type="hidden" th:value="${email}"/>
                    <input name="code" type="hidden" value="code" th:value="${code}"/>
                    <input name="enterprise_username" type="text" placeholder="Username" autocomplete="off" class="form-control"/>
                    <input name="enterprise_password" type="password" placeholder="Password" autocomplete="off" class="form-control"/>
                    <input type="submit" value="Sign in" class="island-button"/>
                </form>
            </th:block>
        </th:block>
    </div>
</div>
</html>
